﻿(function () {
    "use strict";

    WinJS.UI.Pages.define("/pages/home/home.html", {
        // Cette fonction est appelée chaque fois qu'un utilisateur accède à cette page. Elle
        // remplit les éléments de la page avec les données d'application.
        ready: function(element, options) {

            var firstMenu = document.querySelector("#firstMenu");
            var secondMenu = document.querySelector("#secondMenu");
            var thirdMenu = document.querySelector("#thirdMenu");

            MyAnimation.PointerThemeAnimation(firstMenu);
            MyAnimation.PointerThemeAnimation(secondMenu);
            MyAnimation.PointerThemeAnimation(thirdMenu);

            thirdMenu.addEventListener("click", calendar_OnClick, false);
            firstMenu.addEventListener("click", projects_OnClick, false);

            var day = document.querySelector("#Day");
            var dayOfWeek = document.querySelector("#DayOfWeek");

            var now = new Date();

            day.innerText = now.getDate();
            dayOfWeek.innerText = now.toString("dddd");

            //document.querySelector(".myBackButton").addEventListener("click", Application.goBack);
        }
    });

    var calendar_OnClick = function () {
        WinJS.Navigation.navigate('/pages/calendar/mainCalendar/mainCalendar.html');
    };

    var projects_OnClick = function () {
        WinJS.Navigation.navigate('/pages/project/projects/projects.html');
    };

})();
